package com.bkhc.product.repository;

import com.bkhc.common.util.response.PageUtil;
import com.bkhc.common.util.response.ResultJson;
import com.bkhc.common.vo.OrderItemVo;
import com.bkhc.common.vo.OrderVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpMethod;
import org.springframework.http.ResponseEntity;
import org.springframework.stereotype.Component;
import org.springframework.web.client.RestTemplate;

import java.util.List;
import java.util.Map;

@Component
public class BuessinesRepository {
    @Autowired
    private RestTemplate restTemplate;

    public Map getCustomerIndentity(String userId){
        String serviceName = "business-app";
        String url = "http://" + serviceName + "/business/customer/getCustomerIdentity?userId="+userId;
        ResponseEntity<Map> result = restTemplate.exchange(url, HttpMethod.GET,null, Map.class);
        Map object = (Map) result.getBody().get("data");
        return object;
    }
}
